import 'package:flutter/material.dart';
import 'package:flutter2/colors.dart';

import 'base/normal_text.dart';

class InfoView extends StatelessWidget {
  const InfoView({
    super.key,
    this.leftText,
    this.leftColor,
    this.leftSize,
    this.rightText,
    this.rightColor,
    this.rightSize,
    this.hide,
  });

  final String? leftText;
  final Color? leftColor;
  final double? leftSize;
  final String? rightText;
  final Color? rightColor;
  final double? rightSize;
  final bool? hide;

  @override
  Widget build(BuildContext context) {
    return Offstage(
      offstage: hide ?? false,
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 0, vertical: 5),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Expanded(
              flex: 0,
              child: NormalText(
                text: leftText,
                fontSize: leftSize ?? 14,
                fontColor: leftColor ?? mainText2,
              ),
            ),
            Expanded(
              child: NormalText(
                textAlign: TextAlign.end,
                text: rightText,
                fontSize: rightSize ?? 14,
                fontColor: rightColor ?? mainText,
                fontWeight: FontWeight.bold,
              ),
            )
          ],
        ),
      ),
    );
  }
}
